<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 16-4-26
 * Time: 下午6:04
 */
namespace Admin\Model;
use Think\Model;
class UserModel extends Model {
    protected  $_validate = array(
        array('Account','require','用户名不为空！'),
        array('Password','require','密码不为空！'),
        array('Password','/^[\w*-]{6,15}$/','密码格式错误'),
    );
    public function checkUser(){
        $Password = $this->where('Account="'.$this->Account.'"')->getField('Password');
        if ($Password == (md5($this->Password))){
            return true;
        }
        return false;
    }

    public function getUserInfo(){
        $info = $this->where('Account="'.$this->Account.'"')->field('id,Account')->find();
        return $info;
    }

}

?>